package com.xxs.controller.admin;

import com.jfinal.core.Controller;
import com.xxs.model.Admin;
import com.xxs.service.MemberService;
import com.xxs.utils.Pageable;

/**
 */
//@Before(AdminInterceptor.class)
public class MemberController extends Controller {
	
	private MemberService memberService = enhance(MemberService.class);
	
    public void list(){
    	Pageable pageable = getBean(Pageable.class); 
    	setAttr("page", memberService.findPage(pageable));
    	setAttr("pageable", pageable);
    	render("/admin/member/list.ftl");
    }
    public void edit(){
    	Admin bean = Admin.dao.findById(getParaToInt(0));
    	setAttr("bean", bean);
    	render("/admin/member/edit.ftl");
    }
    public void update(){
    	getModel(Admin.class).myUpdate();
        list();
    }
}
